package vip.xiaonuo.smzq.modular.dictionary.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import vip.xiaonuo.smzq.modular.dictionary.entity.Cb03Kspj;
import vip.xiaonuo.smzq.modular.dictionary.mapper.Cb03KspjMapper;
import vip.xiaonuo.smzq.modular.dictionary.service.ICb03KspjService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import vip.xiaonuo.common.page.CommonPageRequest;

import javax.annotation.Resource;
import java.util.List;

/**
 * 矿石品级 服务实现类
 *
 * @author eomer
 * @since 2024-02-21
 */
@Service
public class Cb03KspjServiceImpl extends ServiceImpl<Cb03KspjMapper, Cb03Kspj> implements ICb03KspjService {

    @Resource
    private Cb03KspjMapper cb03KspjMapper;

    @Override
    public Page<Cb03Kspj> page(Cb03Kspj cb03Kspj) {
        QueryWrapper<Cb03Kspj> queryWrapper = new QueryWrapper<>();
        return this.page(CommonPageRequest.defaultPage(), queryWrapper);
    }

    /**
     * 矿产品级筛选下拉
     * kcdm 矿产代码
     */
    @Override
    public List<Cb03Kspj> kcpjList(Integer kcdm) {
        QueryWrapper<Cb03Kspj> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("kcdm",kcdm);
        return cb03KspjMapper.selectList(queryWrapper);
    }
}
